package ru.geyes.screw.thread;

/**
 * @author alex
 *         date 17.05.2008
 *         time 23:24:22
 */
public class ThreadUtils {
    /**
     * sleep thread for millis
     *
     * @param millis time for sleep
     * @throws ThreadInterruptedException for thread interupping 
     */
    public static void sleep(int millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            throw new ThreadInterruptedException(e);
        }
    }

    public static void sleepForever() {
        while (true) {
            try {
                Thread.sleep(Integer.MAX_VALUE);
            } catch (InterruptedException e) {
                throw new ThreadInterruptedException(e);
            }
        }
    }
}
